package br.ufpe.cin.imlm2.jbeat.model;

/*
 * Conceptually speaking a Vector type should be a Reference type but it's being implemented
 * this way for simplicity.
 */
public class LightWeightVectorType extends LightWeightType {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5708021878580084806L;

	private ILightWeightType componentType;
	private int numberOfDimensions;

	public LightWeightVectorType( ILightWeightType componentType, int numberOfDimension ) {
		super( componentType.getFullyQualifiedName() );
		this.componentType = componentType;
		this.numberOfDimensions = numberOfDimension;
	}

	public ILightWeightType getComponentType() {
		return componentType;
	}

	public int getNumberOfDimensions() {
		return numberOfDimensions;
	}

	@Override
	public String getFullyQualifiedName() {
		return this.toString();
	}

	@Override
	public String toString() {
		String brackets = "[]";
		for ( int i = 0; i < this.numberOfDimensions - 1; i++ ) {
			brackets += brackets;
		}
		return super.toString() + brackets;
	}

}
